<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="shortcut icon" href="../img/favicon.ico" >
	<link rel="stylesheet" href="../css/bootstrap.min.css">
	<link rel="stylesheet" href="../css/bootstrap-responsive.css">
	<link rel="stylesheet" href="../css/docs.css">
	<script type="text/javascript" src="../js/bootstrap.min.js"></script>
	 <style type="text/css">
		body{
			background:url(../img/b.png);
			
		}
		
	</style>
</head>
<body class="body">
	<% pageContext.setAttribute("left", "file"); %>
	<%@ include file="include/top.jsp" %>
	
	
	
	
	<!-- Modal -->
	<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-header">
	    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	    <h3 id="myModalLabel">创建文件夹</h3>
	  </div>
	  <div class="modal-body">
	  
	  <form action="savedir.jspx" method="post">
	  	
	  
	    <div class="form-horizontal">
		  <div class="control-group">
		    <label class="control-label" for="inputEmail">文件夹名</label>
		    <div class="controls">
		      <input type="text" name="name"id="inputEmail" placeholder="文件夹名">
		    </div>
		  </div>
		</div>
		
		
	  </div>
	  <div class="modal-footer">
	    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
	    <button type="submit" class="btn btn-primary">确定</button>
	    </form>
	  </div>
	</div>
	
	
	
	
	
	
	
	<div class="container">
	  <div class="row">
		<%@ include file="include/left.jsp" %>
		<div class="span9">
			
			

			
			<div>
				
		 <h1 style="color:#ff7400;margin-bottom:20px;margin-left:15px;display:inline">文件夹：<a href="#myModal" role="button" data-toggle="modal" style="margin-left:600px;" class="btn btn-large btn-success">创建文件夹</a></h1>
		 <hr/>
			</div>
			
			<c:if test="${not empty dirmes }">
			
				<div class="alert alert-success">
	              <button type="button" class="close" data-dismiss="alert">×</button>
	              <strong>${dirmes }</strong>
	            </div>
				<%
					request.getSession().removeAttribute("dirmes");
				%>
			</c:if>
			
			
			<div class="wall">
				<table class="table table-hover">
					<thead>
						<tr>
							<th width="30px"></th>
							<th width="60%">名称</th>
							<th width="20%">大小</th>
							<th>创建人</th>
							<th>编辑</th>
						</tr>
					</thead>
					<tbody>
						
						
						<c:if test="${empty dirlist }">
							<tr>
								<td colspan="4">
									<h3 style="color:red;">还没有任何的文件。。赶紧来创建吧</h3>
								</td>
								
							</tr>
						</c:if>
						
						
						<c:forEach items="${dirlist }" var="s">
							<tr>
								<td>
									<img src="img/folder.png"/>
								</td>
								<td><a href="filetypesession.jspx?id=${s.id }">${s.name }</a></td>
								<td>${s.filenum }个文件 at ${s.viewsize }</td>
								<td>${s.user.username }</td>
								<td><a href="javascript:;" class="mya" value="${s.id }"><i class="icon-trash"></i></a></td>
							</tr>
							
						</c:forEach>
						
						
						
					</tbody>
				</table>
			</div>
			
			
		</div>
	  </div>
	</div>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".mya").click(function(){
				var filetypeid = $(this).attr("value");
				if(confirm("你真的确定要删除资料么？")){
					location.href="removefiletype.jspx?id="+filetypeid;
				}
			});

		});
		
	</script>
	
	
	
</body>
</html>